﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UFrame
{
    /// <summary>
    /// 自身旋转
    /// </summary>
    public class OUSelfRotation : MonoBehaviour
    {
        public Rigidbody2D c2d;
        public float hor = 1;
        public float speed = 20f;

        public void Awake()
        {
            if (c2d == null)
            {
                c2d = GetComponent<Rigidbody2D>();
            }
        }

        private void FixedUpdate()
        {
            c2d.angularVelocity = hor * speed;
        }
    }
}